package com.xique.door.service.impl;


import com.xique.common.core.text.Convert;
import com.xique.door.bean.domain.ElevatorParam;
import com.xique.door.mapper.ElevatorParamMapper;
import com.xique.door.service.IElevatorParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shd
 * @create 2021/10/12 16:44
 */
@Service
public class ElevatorParamServiceImpl implements IElevatorParamService
{
    @Autowired
    private ElevatorParamMapper elevatorParamMapper;

    /**
     * 查询电梯参数
     *
     * @param id 电梯参数ID
     * @return 电梯参数
     */
    @Override
    public ElevatorParam selectElevatorParamById(Long id)
    {
        return elevatorParamMapper.selectElevatorParamById(id);
    }

    @Override
    public ElevatorParam selectElevatorParamByElvId(Long elvId) {
        return elevatorParamMapper.selectElevatorParamByElvId(elvId);
    }

    /**
     * 查询电梯参数列表
     *
     * @param elevatorParam 电梯参数
     * @return 电梯参数
     */
    @Override
    public List<ElevatorParam> selectElevatorParamList(ElevatorParam elevatorParam)
    {
        return elevatorParamMapper.selectElevatorParamList(elevatorParam);
    }

    @Override
    public List<ElevatorParam> selectElevatorParamListByParkId(Long parkId) {
        return elevatorParamMapper.selectElevatorParamListByParkId(parkId);
    }

    /**
     * 新增电梯参数
     *
     * @param elevatorParam 电梯参数
     * @return 结果
     */
    @Override
    public int insertElevatorParam(ElevatorParam elevatorParam)
    {
        return elevatorParamMapper.insertElevatorParam(elevatorParam);
    }

    /**
     * 修改电梯参数
     *
     * @param elevatorParam 电梯参数
     * @return 结果
     */
    @Override
    public int updateElevatorParam(ElevatorParam elevatorParam)
    {
        return elevatorParamMapper.updateElevatorParam(elevatorParam);
    }

    /**
     * 删除电梯参数对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteElevatorParamByIds(String ids)
    {
        return elevatorParamMapper.deleteElevatorParamByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除电梯参数信息
     *
     * @param id 电梯参数ID
     * @return 结果
     */
    @Override
    public int deleteElevatorParamById(Long id)
    {
        return elevatorParamMapper.deleteElevatorParamById(id);
    }
}
